<template>
	<view>
		<view class="">
			这是子组件child
			{{title}}
			<van-button @tap="postMsg">调用父组件的方法 子传父</van-button>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			title:String
		},
		name:"child",
		data() {
			return {
				msg:"这是来自子组件的title"
			};
		},
		methods:{
			postMsg(){
				this.$emit("getMsg",this.msg)
			}
			//子传父 把子组件的title数据传到父组件
		}
	}
</script>

<style lang="scss">

</style>
